package com.kaibes.orm.core.plus;

import com.kaibes.core.base.util.NullUtils;
import com.kaibes.orm.curd.InsertBuilder;

public class InsertBuilderPlus extends InsertBuilder {
    
    @Override
    public InsertBuilderPlus addData(Object data) {
        return (InsertBuilderPlus) super.addData(data);
    }

    public InsertBuilderPlus null2Zero(String... fieldNames) {
        if (fieldNames.length==0) {
            return this;
        }
        NullUtils.null2Value(datas, 0, fieldNames);
        return this;
    }
    
    public InsertBuilderPlus null2True(String... fieldNames) {
        if (fieldNames.length==0) {
            return this;
        }
        NullUtils.null2Value(datas, true, fieldNames);
        return this;
    }
    
    public InsertBuilderPlus null2False(String... fieldNames) {
        if (fieldNames.length==0) {
            return this;
        }
        NullUtils.null2Value(datas, false, fieldNames);
        return this;
    }
    
    public InsertBuilderPlus zero2Null(String... fieldNames) {
        if (fieldNames.length==0) {
            return this;
        }
        NullUtils.zero2Null(datas, fieldNames);
        return this;
    }
    
    public static InsertBuilderPlus newBuilder() {
        return new InsertBuilderPlus();
    }
    
}
